home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Systemmonitors / Snoopy / snoopy.i < prev    next >
Text File  |  1996-09-26  |  9KB  |  255 lines

  1.         IFND    SNOOPY_I
  2. SNOOPY_I    equ    1
  3. IS_LINKABLE    equ    1
  4.  
  5. ;--------------    Hi! This is the main includefile for Snoopy and contains
  6. ;--------------    some rather "important" informations if you want to modify
  7. ;--------------    the code; all data structures are defined in here & loads
  8. ;--------------    of comments give you some details not found anywhere else... 
  9.  
  10. ;--------------    version/revision information
  11. VERSION        equ    2
  12. REVISION    equ    0
  13. VERSINFOSTRING    equstr    _VALOF(VERSION),".",_VALOF(REVISION)
  14. PROGRAMSTRING    equstr    "Snoopy"
  15. DATE        equstr    "January 1,1994"
  16. IDSTRING    equstr    PROGRAMSTRING," ",VERSINFOSTRING," (",DATE,")"
  17. AUTHORSTRING    equstr    "G.Kurz in 1994"
  18. DEFAULTSCRIPT    equstr    "s:snoopy.script"
  19.  
  20. ;--------------    defaults for StringToValue()
  21. STVFORMAT_DEC    equ    0
  22. STVFORMAT_HEX    equ    1
  23. STVFORMAT_OCT    equ    2
  24. STVFORMAT_BIN    equ    3
  25.  
  26. ;--------------    identifications for StringToValue()
  27. STVTYPE_DEC    equ    '#'
  28. STVTYPE_HEX    equ    '$'
  29. STVTYPE_OCT    equ    '@'
  30. STVTYPE_BIN    equ    '%'
  31.  
  32. ;--------------    signals the main wait loop uses
  33. MASK_SIGNALS    equ    SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D|SIGBREAKF_CTRL_E|SIGBREAKF_CTRL_F
  34.  
  35. ;--------------    4 bytes used as a patch identifier
  36. PATCH_IDSTRING    equstr    "LOVE"
  37.  
  38. ;--------------    comment identifiers
  39. COMMENT        equ    ';'
  40. COMMENT_LINE    equ    '*'
  41.  
  42. ;--------------    all internal limits. Some *REAL* asswipe could redefine these to
  43. ;--------------    be like ten times as big each (you know, for those of you with
  44. ;--------------    32 MB of on-board RAM plus some 2.5 GB virtual memory) or 
  45. ;--------------    make a "tiny snoopy" where everything is just one or two bytes
  46. ;--------------    long and in turn completely useless & crap ;-)
  47. MAX_INPUT    equ    512
  48. MAX_BASENAME    equ    116
  49. MAX_DEFINENAME    equ    116
  50. MAX_TASKNAME    equ    116
  51. MAX_INCDIRNAME    equ    256
  52. MAX_INCLUDELEVEL equ    16
  53. MAX_ALIASNAME    equ    120
  54. MAX_ALIASCONTENTS equ    128
  55. MAX_TEMPLATE    equ    512
  56. MAX_ARGUMENTS    equ    64
  57. MIN_UNITNUMBER    equ    0    ; lowest possible unit number
  58. MAX_UNITNUMBER    equ    31    ; highest possible unit number
  59.  
  60. ;--------------    structure for keeping library/resource bases
  61.         STRUCTURE SnoopyBases,MLN_SIZE
  62.         APTR    sbase_Library ; also used as pointer to resources
  63.         STRUCT    sbase_Name,MAX_BASENAME
  64.         LABEL    sbase_SIZEOF
  65.  
  66. ;--------------    structure for (numeric) defines/bitdefs
  67.         STRUCTURE SnoopyDefine,MLN_SIZE
  68.         LONG    sdef_Offset
  69.         STRUCT    sdef_Name,MAX_DEFINENAME
  70.         LABEL    sdef_SIZEOF
  71.  
  72. ;--------------    structure for hide/show tasks
  73.         STRUCTURE SnoopyTask,MLN_SIZE
  74.         APTR    stask_Pointer    ; only valid if non-ZERO
  75.         STRUCT    stask_Name,MAX_TASKNAME
  76.         LABEL    stask_SIZEOF
  77.  
  78. ;--------------    structure for aliases
  79.         STRUCTURE SnoopyAlias,MLN_SIZE
  80.         STRUCT    salias_Name,MAX_ALIASNAME
  81.         STRUCT    salias_Contents,MAX_ALIASCONTENTS
  82.         LABEL    salias_SIZEOF
  83.  
  84. ;--------------    structure for argument definition
  85.         STRUCTURE SnoopyArgument,0
  86.         UWORD    sarg_Opcode
  87.         ULONG    sarg_Offset ; only valid if opcode supports offset-type
  88.         LABEL    sarg_SIZEOF
  89.  
  90. ;--------------    the lower 3 bits are reserved for the register number
  91. REGISTER_0    equ    %000
  92. REGISTER_1    equ    %001
  93. REGISTER_2    equ    %010
  94. REGISTER_3    equ    %011
  95. REGISTER_4    equ    %100
  96. REGISTER_5    equ    %101
  97. REGISTER_6    equ    %110
  98. REGISTER_7    equ    %111
  99.  
  100. ;--------------    supported output types
  101.         BITDEF    REG,DATA,3    ; register Dx
  102.         BITDEF    REG,ADDR,4    ; register Ax
  103.         BITDEF    REG,INDIRECT,5    ; register (Ax,OFFSET) [absolute if none of the above]
  104.         BITDEF    REG,RESULT,6    ; return value
  105.         BITDEF    REG,BOOLEAN,7    ; boolean style output
  106.         BITDEF    REG,BYTE,8    ; size = byte ;;; ****NO SYNTAX CHECKING YET***
  107.         BITDEF    REG,WORD,9    ; size = word
  108.         BITDEF    REG,LONG,10    ; size = long
  109.         BITDEF    REG,ABSOLUTE,11    ; register absolute ;;;; ***UNUSED AS OF YET***
  110. ;--------------    special value: end of register template
  111. REG_DONE    equ    -1
  112.  
  113. ;--------------    structure for library & device patches.
  114.         STRUCTURE SnoopyPatch,MLN_SIZE
  115.         APTR    spatch_Library    ; (struct Library *) or (struct Device *)
  116.         WORD    spatch_Offset    ; function offset or IO command
  117.         LONG    spatch_Flags    ; flags for this patch
  118.         STRUCT    spatch_Template,MAX_TEMPLATE ; output string definition
  119.         STRUCT    spatch_Arguments,(sarg_SIZEOF*MAX_ARGUMENTS) ; output arguments
  120.         LONG    spatch_Timeout    ; timeout value (for DELAY keyword)
  121.         LABEL    spatch_SIZEOF
  122.  
  123. ;--------------    if this bit is set, SegTracker output is DISABLED 
  124. ;--------------    (because default is to ENABLE SegTracker support)
  125.         BITDEF    SINFO,NOSEGTRACKER,0
  126.  
  127. ;--------------    if this bit is set, Snoopy will skip similar calls; i.e.
  128. ;--------------    if calls to the same function are made twice or more times,
  129. ;--------------    only the first call is displayed. NOT TASK SENSITIVE!
  130.         BITDEF    SINFO,SKIPSIMILAR,1
  131.  
  132. ;--------------    the following bits are used only for device patches
  133.         BITDEF    SINFO,BEGINIO,2    ; show if BeginIO
  134.         BITDEF    SINFO,ABORTIO,3    ; show if AbortIO
  135. ;--------------    if both bits are set, no distinction is made [of course]
  136.  
  137. ;--------------    structure for keeping device bases
  138.         STRUCTURE SnoopyDeviceBases,MLN_SIZE
  139.         APTR    sdevbase_MsgPort
  140.         APTR    sdevbase_Device
  141.  
  142. ;--------------    this is actually a bitfield (which explains the restriction
  143. ;--------------    of up to 31 unit numbers); each bit set represents one unit
  144. ;--------------    supported [because the patches apply to all units]. Note that
  145. ;--------------    if this field is -1, no unit checking is done => any unit will do
  146.         LONG    sdevbase_Unit    ; default = -1
  147.  
  148. ;--------------    size of the IO block that is required by this device. 
  149. ;--------------    I didn't want to trust MN_LENGTH, because it seems to be unstable
  150.         LONG    sdevbase_IOSize    ; default = IOSTD_SIZE
  151.  
  152. ;--------------    this structure contains all patches supported for a certain device.
  153.         STRUCT    sdevbase_Patches,LH_SIZE
  154.         STRUCT    sdevbase_Name,MAX_BASENAME
  155.         LABEL    sdevbase_SIZEOF
  156.  
  157. ;--------------    our sexy love connection to SegTracker
  158.         STRUCTURE SegSem,SS_SIZE
  159.         APTR    segs_Find
  160.         LABEL    segs_SIZEOF
  161.  
  162. ;--------------    the function arguments are stored in a structure like this
  163.         STRUCTURE SnoopyRegisters,0
  164.         ULONG    sregs_D0    ; the data registers
  165.         ULONG    sregs_D1
  166.         ULONG    sregs_D2
  167.         ULONG    sregs_D3
  168.         ULONG    sregs_D4
  169.         ULONG    sregs_D5
  170.         ULONG    sregs_D6
  171.         ULONG    sregs_D7
  172.         ULONG    sregs_A0    ; the address registers
  173.         ULONG    sregs_A1
  174.         ULONG    sregs_A2
  175.         ULONG    sregs_A3
  176.         ULONG    sregs_A4
  177.         ULONG    sregs_A5
  178.         ULONG    sregs_A6
  179.         ULONG    sregs_A7
  180.         ULONG    sregs_I0    ; indirect address registers
  181.         ULONG    sregs_I1
  182.         ULONG    sregs_I2
  183.         ULONG    sregs_I3
  184.         ULONG    sregs_I4
  185.         ULONG    sregs_I5
  186.         ULONG    sregs_I6
  187.         ULONG    sregs_I7
  188.         LABEL    sregs_SIZEOF
  189.  
  190. ;--------------    if this bit is set, its a library/resource kind of message,
  191. ;--------------    else its a message from something else
  192.         BITDEF    MSGTYPE,LIBRARY,0
  193.  
  194. ;--------------    if this bit is set, its a device kind of message, else its
  195. ;--------------    a message from something else
  196.         BITDEF    MSGTYPE,DEVICE,1
  197.  
  198. ;--------------    if this bit is set, it comes from BeginIO(), else from AbortIO()
  199.         BITDEF    MSGTYPE,BEGINIO,2
  200.  
  201. ;--------------    each patch sends the following message to the main loop
  202.         STRUCTURE SnoopyMessage,MN_SIZE ; msgport from exec/ports.i
  203.         WORD    smsg_Type        ; type of message
  204.         APTR    smsg_Info        ; pointer to a SnoopyPatch structure
  205.         STRUCT    smsg_RegsBeforeCall,sregs_SIZEOF
  206.         STRUCT    smsg_RegsAfterCall,sregs_SIZEOF
  207.         APTR    smsg_Task        ; the task that called this function
  208.         LABEL    smsg_SIZEOF
  209.  
  210. ;--------------    device patches send a very minimalistic type-of-message; only this:
  211.         STRUCTURE SnoopyDeviceMessage,MN_SIZE ; msgport from exec/ports.i
  212.         WORD    sdmsg_Type        ; type of message
  213.         APTR    sdmsg_DeviceBase    ; (struct SnoopyDeviceBases *)Parent
  214.         APTR    sdmsg_Task        ; (struct Task *)Caller
  215.         APTR    sdmsg_PC        ; for SegTracker support
  216. ;--------------    followed by (smsg_DeviceBase->sdevbase_IOSize) bytes of IO memory
  217.         LABEL    sdmsg_SIZEOF
  218.  
  219. ;--------------    this structure is the top of each library patch
  220.         STRUCTURE SnoopyPatchHead,0
  221.         ULONG    sphead_Ident        ; == PATCH_IDSTRING
  222.         APTR    sphead_Owner        ; task who owns this patch
  223.         APTR    sphead_OriginalFunction    ; original function vector
  224.         APTR    sphead_Info        ; pointer to SnoopyPatch/SnoopyDeviceBase
  225.         LABEL    sphead_SIZEOF
  226.         APTR    sphead_DevicePtr    ; for devices only
  227.         LABEL    sphead_ExtSIZEOF
  228.         
  229.  
  230. ;--------------    this structure is the top of each device patch
  231.         STRUCTURE SnoopyDevicePatchHead,0
  232.         ULONG    sdhead_Ident        ; == PATCH_IDSTRING
  233.         APTR    sdhead_Owner        ; task who owns this patch
  234.         APTR    sdhead_OriginalFunction    ; original function vector
  235.         LONG    sdhead_AllocSize    ; size of message to allocate
  236.         LONG    sdhead_Unit        ; unit to look out for. This
  237.                         ; is a BITFIELD, which means that
  238.                         ; bit0=unit0, bit1=unit1 and so on...
  239.         LABEL    sdhead_SIZEOF
  240.  
  241. ;--------------    this bit is set to recognize DEBUG messages
  242.         BITDEF    MSGTYPE,DEBUG,4
  243.  
  244. ;--------------    a debug message
  245.         STRUCTURE SnoopyDebugMessage,MN_SIZE
  246.         WORD    sumsg_Type
  247.         APTR    sumsg_Task
  248.         APTR    sumsg_Template
  249.         STRUCT    sumsg_RegsBeforeCall,sregs_SIZEOF
  250.         STRUCT    sumsg_RegsAfterCall,sregs_SIZEOF
  251.         LABEL    sumsg_SIZEOF
  252.  
  253.         ENDC    ;SNOOPY_I
  254. ;--------------    
  255.